<template>
    <el-form ref="form" :model="form" label-width="80px">
        <el-form-item label="专题名">
            <el-input v-model="form.name"></el-input>
        </el-form-item>
        <el-form-item label="专题类型">
             <el-select v-model="form.type" placeholder="请选择">
                <el-option
                    v-for="item in options"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value">
                </el-option>
            </el-select>
        </el-form-item>
        <el-form-item>
            <el-button type="primary" @click="onSubmit">立即创建</el-button>
            <el-button>取消</el-button>
        </el-form-item>
    </el-form>
</template>

<script>
import { addTopic } from '@/api/topic.js'
export default {
    data (){
        return {
            form: {
                type: '1',
                name: ''
            },
            options: [{
                value: "1",
                label: '视频'
            },{
                value: "2",
                label: '图片'
            },{
                value: "1",
                label: '音乐'
            }],
           
        }
    },
    methods: {

        onSubmit (){
            addTopicType();    
        },

        addTopicType (){
            addTopic({
                name: this.form.name,
                type: this.form.type
            })
        }
    }
}
</script>

<style>

</style>